package org.easydarwin.util;

import android.text.TextUtils;

/**
 * Created by stamSuper on 2018/1/3.
 * 功能：
 */

public class AccountUtil {
    private static String mineRoleCode;

    public static synchronized boolean isCustom(String roleCode){
        if(TextUtils.isEmpty(roleCode)){
            if(TextUtils.isEmpty(mineRoleCode)){
                mineRoleCode = PreferenceManager.getInstance().getRole("");
            }
            roleCode = mineRoleCode;
        }
        LogUtil.i("================mineRoleCode = "  +mineRoleCode +"-------------roleCode = " + roleCode);

        return "CUSTOMER".equals(roleCode);
    }

    public static String getPlayID(){
        String res = "";
        if(isCustom("")){
            String mineAcount = PreferenceManager.getInstance().getAccount();
            String friend = PreferenceManager.getInstance().getFriendAccount("");
            res = friend +"_" + mineAcount;
        }
        return res;
    }
}
